package com.sky.yipinyoufujava.service.imp;

import com.sky.yipinyoufujava.mapper.ServiceDateMapper;
import com.sky.yipinyoufujava.pojo.from.ServiceDateFrom;
import com.sky.yipinyoufujava.pojo.service.ServiceDate;
import com.sky.yipinyoufujava.pojo.service.ServiceTime;
import com.sky.yipinyoufujava.service.ServiceDateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;


@Service
public class ServiceDateServiceImp implements ServiceDateService {


    @Autowired
    private ServiceDateMapper serviceDateMapper;
    @Override
    public List<ServiceDate> getServiceDate(Object shopsId, LocalDate date) {
        return serviceDateMapper.getServiceDate(shopsId,date);
    }

    @Override
    public List<ServiceTime> getServiceTime(Object serviceId,String timeNow ) {
        return serviceDateMapper.getServiceTime(serviceId,timeNow);
    }

    @Override
    public ServiceDate getShopsServiceDate(ServiceDateFrom serviceDateFrom) {
        return serviceDateMapper.getShopsServiceDate(serviceDateFrom);
    }

    @Override
    public List<ServiceTime> getShopsServiceTime(Integer id) {
        return serviceDateMapper.getShopsServiceTime(id);
    }

    @Override
    public void addServiceTime(ServiceDateFrom serviceDateFrom, List<String> timeIntervals) {
        serviceDateMapper.addServiceTime(serviceDateFrom,timeIntervals);
    }

    @Override
    public Integer queryDateId(String date,String shopsId) {
        return serviceDateMapper.queryDateId(date,shopsId);
    }

    @Override
    public void addServiceDate(ServiceDateFrom serviceDateFrom) {
        serviceDateMapper.addServiceDate(serviceDateFrom);
    }


}
